// src/http/types.ts
import { BusinessError } from "@kit.BasicServicesKit";
import { http } from "@kit.NetworkKit";

export interface HttpRequestConfig {
  url: string;
  options: {
    method?: http.RequestMethod;
    extraData?: any;
    header?: Record<string, string>;
    expectDataType?: http.HttpDataType;
    [key: string]: any;
  };
  extraData?: any;
}

export interface HttpResponse {
  err?: BusinessError;
  data?: http.HttpResponse;
}

export interface HttpInterceptor {
  request?(config: HttpRequestConfig): Promise<HttpRequestConfig>;
  response?(response: HttpResponse): Promise<HttpResponse>;
}